function userCount() {
    $.ajax({
        url:"/user/userCount",
        success(res){
            if (res > 0){
                var userCount = document.getElementById("userCount");
                userCount.innerHTML = res
            }
        }
    })
}

function shopCount() {
    $.ajax({
        url:"/goods/goodsCount",
        success(res){
            if (res > 0){
                var shopCount = document.getElementById("shopCount");
                shopCount.innerHTML = res
            }
        }
    })
}

function getName() {
    $.ajax({
        url: "/user/getUser",
        success(res){
            if (res.name !== undefined && res.name !== null){
                var uname = document.getElementById("uname")
                console.log(res)
                uname.innerHTML = res.name
            }
        }
    })
}
window.addEventListener("load",function () {
    getName()
    shopCount()
    userCount()
})